<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/jsp/comm_css_include.jsp"%>
<!doctype html>
<html>
<head></head>
<body>
	<div class="dbsx-top">
		<ul class="dbsx-topli" id="moreNotice">
			<!-- <li onclick="getMoreNotice()" title="更多"><i class="fa fa-refresh"></i></li> -->
		</ul>
	</div>
	<ul class="col-xs-12 col-sm-12	col-md-12 col-lg-12 dbsx-contentb" id="dbsx-contentb">
	</ul>
	
	<div class="noticecontent" id="noticecontent" style="display: none;">
		<div class="noticecontent-con" id="noticecontent-con"></div>
	</div>
	
	<%@include file="/jsp/comm_js_include.jsp"%>
	
	<script type="text/javascript">
		$(document).ready(function () {
		    getNoticeData();//公告
	    });
		
		/* var page = 1; */
	    
	    function getNoticeData(){
	    	$.dpAjax({
	    		show:false,
		    	url:'${basePath}/OtherNoticeController/homePage/list',
	 			data:{
	 				/* "page":page++,
	 				"rows":10 */
	 			},
	 			success: function(datas){
	 				var html = "";
					 var records = datas.result.rows;
					 if(records && records.length > 0){
						 for(var i in records){
							 var record = records[i];
							 html += "<li><div class='noticeListle'><a href='javascript:void(0);' onclick='showNotice(this);' id='" + record.replaceId + "' class='fontwidth' title='查看详情'>";
							 html += record.titleNotice + "</a></div><div class='dbsxb-contenttime'>";
							 html += formateIntegerTime(record.created,'yyyy-MM-dd') + "</div></li>";
						 }
						/* if(datas.result.page == datas.result.total){
							$('#moreNotice').hide();
						}else{
	 						$('#moreNotice').show();
	 					} */
					 } 
					 $('#dbsx-contentb').append(html);
					 
					 var adeLength = $('#dbsx-contentb').find("li").length;
					 if(adeLength <= 0 ){
						 $('#dbsx-contentb').html('暂无公告');
					 }
					 return;
	             }
		    });
	    }
	    //展示公告详情
	    function showNotice(liObject){
	    	var id = $(liObject).attr('id');
	    	if(!id || id == '') {
	    		return;
	    	}
	    	$.dpAjax({
	    		show:false,
		    	url:'${basePath}/OtherNoticeController/getById',
	 			data:{id:id},
	 			success: function(datas){
	 				  if(datas.flag == "100100") {
	 					  var record = datas.result;
	 					  if(record) {
	 						$("#noticecontent-con").html(record.contentNotice);
					    	layer.open({
							  type: 1,
							  title:'标题：' + record.titleNotice,
							  area: ['90%', '90%'], //宽高
							  content: $('#noticecontent'),
							});
	 					  }
						 return;
					  }
					  if(datas.flag == "100200") {
						  $.fn.showDatas({"datas":datas});
	                	  return;
	                  }
					  layer.msg(datas.message, {icon: 2});
	             }
		   });
	    }
	    //加载更多
	   /*  function getMoreNotice(){
	    	getNoticeData();
	    } */
	</script>
</body>
</html>
